package com.yxinsur.imc.business.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxinsur.imc.business.enums.ChargeIntervalEnum;
import com.yxinsur.imc.business.enums.ChargePeriodEnum;
import com.yxinsur.imc.business.enums.OrderStatusCodeEnum;
import com.yxinsur.imc.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 预收报表 VO
 *
 * @author imc
 * @date 2021-05-17
 */
@Data
@ToString
public class ReportAdvanceExportVo
{
    private static final long serialVersionUID = 1L;

    /** 保单号，合同号 */
    @Excel(name ="保单号")
    private String policyCode;

    /** 投保单号 */
    @Excel(name ="投保单号")
    private String proposalCode;

    /** 险种状态 */
    @Excel(name ="保单状态",dictType = "order_status_code",comboDicType = "order_status_code")
    private String riskStatusCode;

    /** 代理人姓名 */
    @Excel(name ="服务代理人姓名")
    private String brokerName;

    /** 代理人代码 */
    @Excel(name ="服务代理人代码")
    private String brokerCode;

    /** 代理人职级 */
    @Excel(name ="服务代理人职级")
    private String brokerLevel;

    /** 机构名称 */
    @Excel(name ="管理机构")
    private String orgName;

    /** 直辖团队 */
    @Excel(name ="直辖团队")
    private String teamName;

    /** 所辖团队 */
    @Excel(name ="所辖团队")
    private String suoxiaName;

    /** 供应商 */
    @Excel(name ="供应商")
    private String supplierName;

    /** 险种代码 */
    @Excel(name ="险种代码")
    private String insCode;

    /** 险种名称 */
    @Excel(name ="险种名称")
    private String riskName;

    /** 预收日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name ="投保日期")
    private String applyDate;

    /** 承保日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name ="承保日期")
    private String insureDate;

    /** 保单生效日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name ="生效日期")
    private String effectiveDate;

    /** 应缴日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name ="应缴日期")
    private String payableDate;

    /** 实缴日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name ="实缴日期")
    private String paymentDate;

    /** 保单年度 */
    @Excel(name ="保单年度")
    private Integer policyYear;

    /** 缴费频率类型 */
    @Excel(name ="缴费频率类型",dictType = "charge_interval",comboDicType = "charge_interval")
    private String chargeIntervalEnum;

    /** 缴费年期类型 */
    @Excel(name ="缴费期间类型",dictType = "charge_period",comboDicType = "charge_period")
    private String chargePeriodEnum;

    /** 缴费期限 */
    @Excel(name ="缴费期限")
    private String chargePeriodValue;

    /** 缴费期数 */
    @Excel(name ="缴费期数")
    private Integer payNum;


    /** 险种保费-首年/首次 */
    @Excel(name ="首年保费（元）")
    private BigDecimal prem;

    /** 应收保费 */
    @Excel(name ="应缴保费（元）")
    private BigDecimal payablePrem;

    /** 实收保费 */
    @Excel(name ="实缴保费（元）")
    private BigDecimal paymentPrem;

    /** 手续费状态 */
    @Excel(name ="手续费状态",dictType = "sys_yes_no",comboDicType = "sys_yes_no")
    private String isFeeSettled;

    /** 佣金发放状态 */
    @Excel(name ="佣金发放状态",dictType = "sys_yes_no",comboDicType = "sys_yes_no")
    private String isCommPaid;

    /** 折标率 */
    @Excel(name = "折标率")
    private BigDecimal standRate;

    /** 首期标保 */
    @Excel(name = "首年标保")
    private BigDecimal standPrem;

    /** 佣金率 */
    @Excel(name = "佣金率")
    private BigDecimal commissionRate;

    /** 佣金 */
    @Excel(name = "佣金")
    private BigDecimal commission;

    /** 手续费率 */
    private BigDecimal feeRate;

    /** 手续费 */
    private BigDecimal baseFee;


    /** 险种基本保额 */
    private BigDecimal amount;

    /** 客户回执签收时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String custAckDate;

    /** 客户回执签收时间 */
   // private String inputTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date revisitDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date ackDate;

    /** 投保人姓名 */
    private String applicantName;


    @Excel(name ="投保人性别" ,dictType="sys_user_sex", readConverterExp = "0=男,1=女,2=未知")
    private String applicantGender;
    @Excel(name = "投保人职业名称")
    private String applicantOccName;
    @Excel(name = "投保人证件类型")
    private String applicantCertiType;
    @Excel(name = "投保人证件号码")
    private String applicantCertiCode;
    @Excel(name = "投保人出生日期")
    private String applicantBirthday;
    @Excel(name = "投保人证件到期时间")
    private String applicantCertiExpiryDate;
    @Excel(name = "投保人联系方式")
    private String applicantMobile;
    @Excel(name = "投保人住宅电话")
    private String applicanthouseTel;
    @Excel(name = "投保人省")
    private String applicantProvince;
    @Excel(name = "投保人市")
    private String applicantCity;
    @Excel(name = "投保人区")
    private String applicantCounty;
    @Excel(name = "投保人家庭地址")
    private String applicantHomeAddr;
    @Excel(name = "投保人婚姻状况")
    private String applicantMaritalStatus;
    @Excel(name = "投保人通讯地址")
    private String applicantMailAddr;
    @Excel(name = "投保人邮政编码")
    private String applicantPostalcode;
    @Excel(name = "投保人邮箱")
    private String applicantEmail;
    @Excel(name = "投保人收入")
    private String applicantIncome;
    @Excel(name = "投保人身高")
    private String applicantHeight;
    @Excel(name = "投保人体重")
    private String applicantWeight;
    @Excel(name = "投保人工作单位")
    private String applicantWorkUnit;
    @Excel(name = "投保人工作单位地址")
    private String applicantUnitAddr;

    @Excel(name = "被保人姓名")
    private String insurantName;
    @Excel(name = "被保人性别" ,dictType="sys_user_sex", readConverterExp = "0=男,1=女,2=未知")
    private String insurantGender;
    @Excel(name = "被保人职业名称")
    private String insurantOccName;
    @Excel(name = "被保人证件类型")
    private String insurantCertiType;
    @Excel(name = "被保人证件号码")
    private String insurantCertiCode;
    @Excel(name = "被保人出生日期")
    private String insurantBirthday;
    @Excel(name = "被保人证件到期时间")
    private String insurantCertiExpiryDate;
    @Excel(name = "被保人联系方式")
    private String insurantMobile;
    @Excel(name = "被保人住宅电话")
    private String insuranthouseTel;
    @Excel(name = "被保人省")
    private String insurantProvince;
    @Excel(name = "被保人市")
    private String insurantCity;
    @Excel(name = "被保人区")
    private String insurantCounty;
    @Excel(name = "被保人家庭地址")
    private String insurantHomeAddr;
    @Excel(name = "被保人婚姻状况")
    private String insurantMaritalStatus;
    @Excel(name = "被保人通讯地址")
    private String insurantMailAddr;
    @Excel(name = "被保人邮政编码")
    private String insurantPostalcode;
    @Excel(name = "被保人邮箱")
    private String insurantEmail;
    @Excel(name = "被保人收入")
    private String insurantIncome;
    @Excel(name = "被保人身高")
    private String insurantHeight;
    @Excel(name = "被保人体重")
    private String insurantWeight;
    @Excel(name = "被保人工作单位")
    private String insurantWorkUnit;
    @Excel(name = "被保人工作单位地址")
    private String insurantUnitAddr;
    @Excel(name = "被保人与投保人关系")
    private String insurantRelationWithApplicant;

    @Excel(name = "受益人姓名")
    private String favourName;
    @Excel(name = "受益人性别" ,dictType="sys_user_sex", readConverterExp = "0=男,1=女,2=未知")
    private String favourGender;
    @Excel(name = "受益人职业名称")
    private String favourOccName;
    @Excel(name = "受益人证件类型")
    private String favourCertiType;
    @Excel(name = "受益人证件号码")
    private String favourCertiCode;
    @Excel(name = "受益人出生日期")
    private String favourBirthday;
    @Excel(name = "受益人证件到期时间")
    private String favourCertiExpiryDate;
    @Excel(name = "受益人联系方式")
    private String favourMobile;
    @Excel(name = "受益人住宅电话")
    private String favourhouseTel;
    @Excel(name = "受益人省")
    private String favourProvince;
    @Excel(name = "受益人市")
    private String favourCity;
    @Excel(name = "受益人区")
    private String favourCounty;
    @Excel(name = "受益人家庭地址")
    private String favourHomeAddr;
    @Excel(name = "受益人婚姻状况")
    private String favourMaritalStatus;
    @Excel(name = "受益人通讯地址")
    private String favourMailAddr;
    @Excel(name = "受益人邮政编码")
    private String favourPostalcode;
    @Excel(name = "受益人邮箱")
    private String favourEmail;
    @Excel(name = "受益人收入")
    private String favourIncome;
    @Excel(name = "受益人身高")
    private String favourHeight;
    @Excel(name = "受益人体重")
    private String favourWeight;
    @Excel(name = "受益人工作单位")
    private String favourWorkUnit;
    @Excel(name = "受益人工作单位地址")
    private String favourUnitAddr;
    @Excel(name = "受益人与投保人关系")
    private String favourRelationWithApplicant;
    @Excel(name = "是否法定受益人" ,dictType="sys_yes_no")
    private String favourIsLegalBeneficiary;
    @Excel(name = "受益顺序")
    private String favourBenefitOrder;
    @Excel(name = "受益比例")
    private String favourBenefitRate;
    @Excel(name = "是否同投保人",dictType="sys_yes_no")
    private String favourIsSameApplicant;
    @Excel(name = "受益人与被保险人关系")
    private String favourRelationWithInsurant;

    @Excel(name = "银行户名")
    private String bankAccName;
    @Excel(name = "银行账号")
    private String bankAccount;
    @Excel(name = "银行名")
    private String bankName;


    public String getRiskStatusCode() {
        if(riskStatusCode.equals(OrderStatusCodeEnum.STATUS_10.getCode())) return "失效";
        if(riskStatusCode.equals(OrderStatusCodeEnum.STATUS_20.getCode())) return "生效";
        if(riskStatusCode.equals(OrderStatusCodeEnum.STATUS_30.getCode())) return "撤销";
        if(riskStatusCode.equals(OrderStatusCodeEnum.STATUS_40.getCode())) return "终止";
        if(riskStatusCode.equals(OrderStatusCodeEnum.STATUS_50.getCode())) return "中止";
        return riskStatusCode;
    }

    public String getChargePeriodEnum() {
        if(chargePeriodEnum.equals(ChargePeriodEnum.AGE.getCode())) return "交至确定年龄";
        if(chargePeriodEnum.equals(ChargePeriodEnum.YEAR.getCode())) return "按年限交";
        return chargePeriodEnum;
    }

    public String getChargeIntervalEnum() {
        if(chargeIntervalEnum.equals(ChargeIntervalEnum.B.name())) return "年缴";
        if(chargeIntervalEnum.equals(ChargeIntervalEnum.E.name())) return "月缴";
        if(chargeIntervalEnum.equals(ChargeIntervalEnum.C.name())) return "半年缴";
        if(chargeIntervalEnum.equals(ChargeIntervalEnum.D.name())) return "季缴";
        return chargeIntervalEnum;
    }

    public String getApplicantGender() {
        if(applicantGender.equals("1")) return "女";
        if(applicantGender.equals("0")) return "男";
        return "未知";
    }

    public String getInsurantGender(){
        if(insurantGender.equals("1")) return "女";
        if(insurantGender.equals("0")) return "男";
        return "未知";
    }

    public String getFavourGender(){
        if(favourGender.equals("1")) return "女";
        if(favourGender.equals("0")) return "男";
        return "未知";
    }
}
